/*************************************************************************
	> File Name: tests/uart.c
	> Author: 
	> Mail: 
	> Created Time: 2020年12月15日 星期二 21时57分24秒
 ************************************************************************/

// #define UART_STATE (*(unsigned int*)0x00100008)
// #define UART_DATA  (*(unsigned int*)0x00100004)

#define UART_DATA  (*(unsigned int*)0x10000004)
#define UART_STATE (*(unsigned int*)0x10000008)

#define SW_BUTTON_REG (*(unsigned int*)0x10001000)

#define PWM_PERIOD_REG (*(unsigned int*)0x10002000)
#define PWM_DUTY_REG   (*(unsigned int*)0x10002004)

#define DIGITAL_CTRL_SEL (*(unsigned int*)0x10007000)
#define DIGITAL_CTRL_VAL (*(unsigned int*)0x10007004)


int main()
{	
	unsigned int sw_btn_map;
	unsigned char ureg;
	DIGITAL_CTRL_SEL = 0;
	DIGITAL_CTRL_VAL = 5;
	DIGITAL_CTRL_SEL = 1;
	DIGITAL_CTRL_VAL = 6;
	DIGITAL_CTRL_SEL = 2;
	DIGITAL_CTRL_VAL = 7;
	//SW_BUTTON_READ
	while(1) {
		sw_btn_map = SW_BUTTON_REG;
		if (sw_btn_map & 0x01) {
			DIGITAL_CTRL_SEL = 0;
			DIGITAL_CTRL_VAL = 1;
		}
		if (sw_btn_map & 0x02) {
			DIGITAL_CTRL_SEL = 1;
			DIGITAL_CTRL_VAL = 2;
		}
		if (sw_btn_map & 0x04) {
			DIGITAL_CTRL_SEL = 2;
			DIGITAL_CTRL_VAL = 8;
		}

	}
	return 0;
}
